<template>
	<view class="container">
		<view class="tabs">
			<v-tabs :tabs="tabs" v-model="current" line-color="#C7B099" active-color="#C7B099" style="width: 100%"
				ref="tabs" @change="changeTab"></v-tabs>
		</view>
		<!-- 订单列表 -->
		<view class="container-tabs__list">
			<swiper class="container-tabs__swiper" :current="swiperCurrent" @animationfinish="animationFinished">
				<swiper-item class="swiper-item" v-for="(outItem, outIndex) in tabs" :key="outIndex">
					<!-- <scroll-view class="qh"> -->
					<qYjcxx v-if="outIndex == 0" :QI="queryInfo"></qYjcxx>
					<!-- </scroll-view> -->
					<!-- <scroll-view class="qh"> -->
					<qYswsj v-if="outIndex == 1" :QI="queryInfo"></qYswsj>
					<!-- </scroll-view> -->
					<!-- <scroll-view class="qh"> -->
					<qYcwsj v-if="outIndex == 2" :QI="queryInfo"></qYcwsj>
					<!-- </scroll-view> -->
					<!-- <scroll-view class="qh"> -->
					<qYfphz v-if="outIndex == 3" :QI="queryInfo"></qYfphz>
					<!-- </scroll-view> -->
					<!-- <scroll-viewclass="qh"> -->
					<qYgysxx v-if="outIndex == 4" :QI="queryInfo"></qYgysxx>
					<!-- </scroll-view> -->
					<!-- 			<scroll-view v-if="outIndex == 5" class="qh">
						<qYjkxx :QI="queryInfo"></qYjkxx>
					</scroll-view>
					<scroll-view v-if="outIndex == 6" class="qh">
						<qYxyxx :QI="queryInfo"></qYxyxx>
					</scroll-view>
					<scroll-view v-if="outIndex == 7" class="qh">
						<qYxjllb :QI="queryInfo"></qYxjllb>
					</scroll-view> -->
					<!-- 	<scroll-view v-if="outIndex == 8" class="qh">
						<qYrysbtz :QI="queryInfo"></qYrysbtz>
					</scroll-view>
					<scroll-view v-if="outIndex == 9" class="qh">
						<qYjkxx :QI="queryInfo"></qYjkxx>
					</scroll-view>
					<scroll-view v-if="outIndex == 10" class="qh">
						<qYspxx :QI="queryInfo"></qYspxx>
					</scroll-view> -->
				</swiper-item>
			</swiper>
		</view>
		<template v-if="orderNo">
			<liu-drag-button @clickBtn="FP()" :bottomPx="85">发票</liu-drag-button>
			<liu-drag-button @clickBtn="FX()">分享</liu-drag-button>
		</template>
	</view>
</template>

<script>
	import qYcwsj from '@/components/qy-cwsj.vue'
	import qYfphz from '@/components/qy-fphz.vue'
	import qYgysxx from '@/components/qy-gysxx.vue'
	import qYjcxx from '@/components/qy-jcxx.vue'
	// import qYjkxx from '@/components/qy-jkxx.vue'
	// import qYkhxx from '@/components/qy-khxx.vue'
	// import qYrysbtz from '@/components/qy-rysbtz.vue'
	// import qYspxx from '@/components/qy-spxx.vue'
	import qYswsj from '@/components/qy-swsj.vue'
	// import qYxjllb from '@/components/qy-xjllb.vue'
	// import qYxyxx from '@/components/qy-xyxx.vue'

	import {
		comTemInfo
	} from '@/utils/comTemInfo.js'

	import {
		getPayTaxesData
	} from '@/api/jinjian.js'
	export default {
		components: {
			qYcwsj,
			qYfphz,
			qYgysxx,
			qYjcxx,
			// qYjkxx,
			// qYkhxx,
			// qYrysbtz,
			// qYspxx,
			qYswsj,
			// qYxjllb,
			// qYxyxx
		},
		data() {
			return {
				current: 0,
				swiperCurrent: 0,
				tabs: [
					'基本信息',
					'税务数据',
					'财务数据',
					'发票汇总',
					'供应商信息',
					// '客户信息',
					// '下游信息',
					// '现金流量表',
					// '人员社保投资方',
					// '缴款信息',
					// '商品信息'
				],
				orderNo: undefined,
				queryInfo: {}
			}
		},
		onLoad(options) {
			this.$modal.loading("正在查询......")
			if (options.orderNo) {
				this.orderNo = options.orderNo
				getPayTaxesData({
					orderNo: this.orderNo,
					name: 3
				}).then(res => {
					if (res.code === 200) {
						this.queryInfo = res.data.data
					} else {
						this.$modal.alert(res.msg)
					}
					this.$modal.closeLoading()
				})
			} else {
				this.queryInfo = comTemInfo
				this.$modal.closeLoading()
			}
		},

		methods: {
			animationFinished(e) {
				this.current = e.detail.current
				this.swiperCurrent = e.detail.current
			},
			changeTab(index) {
				this.swiperCurrent = index
			}
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		background-color: #f3f3f3;
		padding: 0px;
		box-sizing: border-box;

		.tabs {
			position: fixed;
			/* #ifdef H5 */
			top: 0px;
			/* #endif */
			/* #ifndef H5 */
			top: 0;
			/* #endif */
			left: 0;
			display: flex;
			align-items: center;
			width: 100%;
			height: 100rpx;
			box-sizing: border-box;
			background-color: #fff;
			box-shadow: 0px 0px 10rpx rgba(0, 0, 0, 0.1);
			border-radius: 0px 0px 10rpx 10rpx;
			z-index: 3;
		}

		.container-tabs__list {
			height: 100%;

			.container-tabs__swiper {
				height: 1000px;

				.swiper-item {
					height: 100%;
					overflow: auto; // 超出这个最大高度的数据，会被隐藏起来，上下滑动
					overflow-x: hidden; //隐藏x轴滚动条
				}
			}
		}
	}
</style>